package com.example.commonbiz

import retrofit2.http.Body
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface ApiService {

    @GET("users/{id}")
    suspend fun getUser(@Path("id") userId: Int): ApiResponse<User>

    @GET("users")
    suspend fun getUsers(): ApiResponse<List<User>>

    @POST("users")
    suspend fun createUser(@Body user: User): ApiResponse<User>

    @POST("login/auth")
    suspend fun login(
        @Body user: RequestUser
    ): ApiResponse<String> // 返回token
}